package com.dh.cb;

import lombok.Data;

import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

@Data
public class LoadTask {

    private int index;

    private List<String> rows;

    public LoadTask(List<String> rows, int index) {
        this.rows = rows;
        this.index = index;
    }

    public void work() {
        long start = System.currentTimeMillis();
      //  System.out.println("\n\n\nstart load index----" + index + " size " + rows.size());
        try {
            Thread.sleep(ThreadLocalRandom.current().nextInt(3000) + 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        long end = System.currentTimeMillis();
        System.out.println("\nend load index----" + index + " size " + rows.size() + " time is " + (end - start));

    }

}
